package model.user;

import java.util.Date;

public class Staff extends User implements Cloneable{
    private String name = "";
    private int title = -1;          //职称及其映射表
    public static final String[] titleID = {"医生","护士","护工"};
    private Date birthday = new Date();
    private String specialty = "";   //专长
    private String tel = "";
    private String idNumber = "";
    private String uid = "";
    private boolean isDeleted = false;

    public Staff(String userName, String password, String name, int title, Date birthday, String specialty, String tel, String idNumber, String uid) {
        super(userName, password);
        this.name = name;
        this.title = title;
        this.birthday = birthday;
        this.specialty = specialty;
        this.tel = tel;
        this.idNumber = idNumber;
        this.uid = uid;
        this.isDeleted = false;
    }

    public Staff() {
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public boolean isDeleted() {
        return isDeleted;
    }

    public void setDeleted(boolean deleted) {
        isDeleted = deleted;
    }

    public String getName() {
        return name;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public void setSpecialty(String specialty) {
        this.specialty = specialty;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    public Date getBirthday() {
        return birthday;
    }

    public String getSpecialty() {
        return specialty;
    }

    public String getTel() {
        return tel;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public String getUid() {
        return uid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Staff staff = (Staff) o;
        return uid.equals(staff.uid) && isDeleted==staff.isDeleted;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return new Staff( getUserName(),  getPassword(),  name,  title,  birthday,  specialty,  tel,  idNumber,  uid);
    }

    @Override
    public String toString() {
        return "Staff{" +
                "name='" + name + '\'' +
                ", title=" + title +
                ", birthday=" + birthday +
                ", specialty='" + specialty + '\'' +
                ", tel='" + tel + '\'' +
                ", idNumber='" + idNumber + '\'' +
                ", uid='" + uid + '\'' +
                "} " + super.toString();
    }
}
